In [ ]:
from simpleazure import SimpleAzure as saz
In [ ]:
azure = saz()
azure.asm.get_config()
In [ ]:
adsc = azure.asm.get_registered_image(name="Azure-Data-Science-Core")
azure.asm.set_image(image=adsc)
azure.asm.set_location("West Europe")
azure.asm.create_cluster(3)
In [ ]:
from simpleazure.plugin import ipython
In [ ]:
ipy = ipython.IPython()
In [ ]:
ipy.set_username(azure.get_username())
ipy.set_private_key(azure.get_pkey())
In [ ]:
from simpleazure import config
master = config.get_azure_domain(azure.results['master'])
engines = [ config.get_azure_domain(x) for x in azure.results.keys()]
Then, we assign the names to ipython plugin.
In [ ]:
ipy.set_master(master)
ipy.set_engines(engines)
In [ ]:
ipy.init_ssh()
init_ssh() above makes paramiko objects to establish ssh.
connect_nodes() actually make connections to nodes.
In [ ]:
ipy.connect_nodes()
In [ ]:
ipy.create_profile()
In [ ]:
ipy.run_ipcontroller()
In [ ]:
ipy.copy_pkey_to_nodes() # <- Temporary function to distribute id_rsa private key to node(s)
ipy.copy_json2engines()
In [ ]:
ipy.run_ipengine()
It's finally done. You can now access to the master node and use IPython.parallel.Client module.
Note. thses steps can be replaced with a single wrapper function apply_ipcluster().
In [ ]:
ipy.apply_ipcluster(azure)